﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using PetaPoco;

namespace doufu.Model
{
    [TableName("story")]
    [PrimaryKey("id")]
    public class story : ModelBase
    {
        // [RegularExpression(@"^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$",
        //    ErrorMessage = "请输入正确的Email格式\n示例：abc@123.com")]
        // [DisplayName("网址")]
        //[RegularExpression(@"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?",
        //    ErrorMessage = "请输入合法的网址!\n示例：https://abc.a;http://www.abc.dd")]
        public int id { get; set; }
        [DisplayName("标题")]
        [Required()]
        public string story_title { get; set; }
        [DisplayName("内容")]
        public string story_content { get; set; }
        [DisplayName("分类")]
        public int story_category { get; set; }
        //[IntegerAttribute()]
        //[Required(ErrorMessage = "姓名不能为空")]
        //[Remote("GetUser", "users", ErrorMessage = "该姓名已存在")]
        //[StringLength(6, ErrorMessage = "密码不能超过6个字符")]
        [DisplayName("SEO")]
        public string story_seo { get; set; }
        public DateTime modified_at { get; set; }
        public int modified_by { get; set; }
        public Guid guid { get; set; }
        [DisplayName("点击量")]
        public int click { get; set; }
        [Ignore]
        public virtual string category_name { get; set; }
        [Ignore]
        public virtual string created_by_name { get; set; }
    }
    [TableName("story")]
    [PrimaryKey("id")]
    public class storyDetails : story
    {
        public override string category_name { get; set; }
        public override string created_by_name { get; set; }
    }
}